//
//  ZPStateReadyTabCell.m
//  ZPIOSEducation
//
//  Created by mini1 on 2016/12/12.
//  Copyright © 2016年 mini1. All rights reserved.
//

#import "ZPStateReadyTabCell.h"
@interface ZPStateReadyTabCell (){
    
    __weak IBOutlet NSLayoutConstraint *xubaoC;
    __weak IBOutlet NSLayoutConstraint *tiaokeC;
    __weak IBOutlet NSLayoutConstraint *zhuanbanC;
    __weak IBOutlet NSLayoutConstraint *tuibanC;
}

@end

@implementation ZPStateReadyTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)tuibanA:(UIButton *)sender {
    if (_delegate&&[_delegate respondsToSelector:@selector(xubao:)]) {
        [_delegate tuiban:_idxP];
    }
}
- (IBAction)tiaobanA:(UIButton *)sender {
    if (_delegate&&[_delegate respondsToSelector:@selector(tiaoke:)]) {
        [_delegate zhuanban:_idxP];
    }
}
- (IBAction)zhuanbanA:(UIButton *)sender {
    if (_delegate&&[_delegate respondsToSelector:@selector(zhuanban:)]) {
        [_delegate tiaoke:_idxP];
    }
}
- (IBAction)xubaoA:(UIButton *)sender {
    if (_delegate&&[_delegate respondsToSelector:@selector(tuiban:)]) {
        [_delegate xubao:_idxP];
    }
}
- (IBAction)ditu:(id)sender {
    if (_delegate&&[_delegate respondsToSelector:@selector(ditu:)]) {
        [_delegate ditu:_idxP];
    }
}


-(void)setButtonType:(NSArray *)buttonType{
    _buttonType = buttonType;
    
    tuibanC.constant=zhuanbanC.constant=tuibanC.constant=xubaoC.constant=0;
    
    for (id tmp in _buttonType) {
        NSInteger i = [[NSString stringWithFormat:@"%@",tmp] integerValue];
        switch (i) {
            case 1:
                tuibanC.constant=64;
                break;
                case 2:
                zhuanbanC.constant=64;
                break;
            case 3:
                tiaokeC.constant = 64;
                break;
            case 4:
                xubaoC.constant = 64;
                break;
                
            default:
                break;
        }
    }
    [self setNeedsUpdateConstraints];
    
    
    
    
}
@end
